<template>
	<view class="cardbox">
	
		<view class="title" style="flex:1 ;display: flex;">
			
			<view style="padding-left:10rpx ;"><text >{{title}}</text></view>
		</view>
		<view class="tips">
			<text v-if="isTop" class="tips" style="color: red;">置顶</text>
			<text class="tips">{{author}}</text>
			<text class="tips">{{comments}}评</text>
			<view class="tips" style="flex:1;display: flex;justify-content: flex-end;">
				<text>{{timedata}}</text>
			</view>
			
		</view>
	</view>
</template>

<script>
	export default {
		name: "cardViewText",
		data() {
			return {
				title: "党二十届四中全会",
				isTop: true,
				author: "人民日报",
				comments: 3126,
				timedata: "2025.10.28"
			};
		},
		props: {
			title: {
				type: String,
				default: "新闻标题",
				require: true
			},
			isTop: {
				type: Boolean,
				default: false,
				require: true
			},
			author: {
				type: String,
				default: "来源",
				require: true
			},
			comments: {
				type: Number,
				default: 0,
				require: true
			},
			timedata: {
				type: String,
				default: "2000.1.1",
				require: true
			}
		},
		methods: {

		}

	}
</script>

<style>
	.cardbox {
		background-color: #fff;
		box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
		
		margin: 20rpx;
		border-radius: 10rpx;
	}

	.title {
		font-weight: bold;
		font-size: 35rpx;
		padding: 10rpx;
	}

	.tips {
		color: #717171;
		padding: 10rpx;
		margin-right: 10rpx;
		display: flex;
		flex-direction: row;
	}
</style>